package evolution.individual;

import evolution.problem.FitnessFunction;

public class FitnessFunctionIndividualsFactory implements IndividualsFactory {

	private FitnessFunction fitnessFunction;

	public FitnessFunctionIndividualsFactory(FitnessFunction fitnessFunction) {
		this.fitnessFunction = fitnessFunction;
	}

	@Override
	public Individual create() {
		RealCodedIndividual realCodedIndividual = new RealCodedIndividual();
		realCodedIndividual.setFitnessFunction(getFitnessFunction());
		return realCodedIndividual;
	}

	public FitnessFunction getFitnessFunction() {
		return fitnessFunction;
	}

	public void setFitnessFunction(FitnessFunction fitnessFunction) {
		this.fitnessFunction = fitnessFunction;
	}

}
